/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: 'Microsoft YaHei', '微软雅黑', 'SimSun', '宋体', Arial, sans-serif;
    background: #ffffff;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    /* 基础字体大小，会根据视口大小自动缩放，适当放大 */
    font-size: clamp(20px, 3.5vw, 26px);
}

/* 主容器 */
.container {
    width: 100%;
    height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: 1000px;
    margin: 0 auto;
}

/* 搜索容器 */
.search-container {
    position: relative;
    width: 100%;
    margin: 0 auto 25px auto;
    flex-shrink: 0;
}

.search-input {
    width: 100%;
    padding: 18px 60px 18px 25px;
    /* 响应式字体大小，调小一些 */
    font-size: clamp(16px, 3vw, 22px);
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    outline: none;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.search-input:focus {
    border-color: #007bff;
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
    background: #fff;
}

.search-icon {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    /* 响应式图标大小，与搜索框匹配 */
    font-size: clamp(18px, 3.5vw, 26px);
    color: #666;
    pointer-events: none;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

/* 自定义滚动条 */
.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 公告列表 */
.announcement-list {
    display: grid;
    gap: 25px;
    padding-bottom: 20px;
}

/* 公告卡片 */
.announcement-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e8e8e8;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}

.announcement-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.announcement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #1976d2;
}

/* 卡片标题 */
.card-title {
    /* 响应式标题字体大小，适当放大 */
    font-size: clamp(26px, 5vw, 36px);
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 12px;
}

.exam-type-tag {
    background: #1976d2;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    /* 响应式标签字体大小，适当放大 */
    font-size: clamp(16px, 3vw, 20px);
    font-weight: 500;
}

/* 卡片内容 */
.card-content {
    display: grid;
    gap: 12px;
}

.info-row {
    display: flex;
    align-items: center;
    /* 适当增加标签与内容之间的间距 */
    gap: 16px;
    /* 响应式字体大小，适当放大 */
    font-size: clamp(20px, 3.5vw, 26px);
    line-height: 1.4;
}

/* 报名截止行特殊布局 */
.deadline-row {
    justify-content: space-between;
    align-items: center;
}

.deadline-row .info-label {
    flex-shrink: 0;
}

.deadline-row .info-value {
    flex: 1;
}

.deadline-row .card-actions {
    margin: 0;
    margin-left: auto;
}

.info-label {
    font-weight: 500;
    color: #666;
    /* 最小宽度适应新的字体大小 */
    min-width: clamp(120px, 18vw, 140px);
    flex-shrink: 0;
    /* 响应式字体大小，适当放大 */
    font-size: clamp(20px, 3.5vw, 24px);
    line-height: 1.2;
    display: flex;
    align-items: center;
}

.info-value {
    color: #333;
    flex: 1;
    word-break: break-word;
    /* 响应式字体大小，适当放大 */
    font-size: clamp(20px, 3.5vw, 26px);
}

/* 特殊样式 */
/* 招录人数特殊样式 */
.recruit-count-value {
    color: #1976d2 !important;
    font-weight: 600 !important;
    /* 响应式字体大小，适当放大 */
    font-size: clamp(22px, 4vw, 28px) !important;
}

/* 报名截止时间样式 */
.deadline-info {
    color: #f44336 !important;
    font-weight: 600 !important;
    /* 响应式字体大小，适当放大 */
    font-size: clamp(22px, 4vw, 28px) !important;
}
.deadline-unlimited {
    color: #4caf50 !important;
    font-weight: 600 !important;
    /* 响应式字体大小，适当放大 */
    font-size: clamp(22px, 4vw, 28px) !important;
}

.deadline-pending {
    color: #ff9800 !important;
    font-weight: 600 !important;
    /* 响应式字体大小，适当放大 */
    font-size: clamp(22px, 4vw, 28px) !important;
}

.website-link {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.website-link:hover {
    border-bottom-color: #3498db;
    color: #2980b9;
}

/* 卡片操作按钮区域 */
.card-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* 在截止时间行中的按钮组 */
.deadline-row .card-actions {
    margin-top: 0;
    margin-left: 16px;
}

.action-button {
    background: #e8e8e8;
    color: #666;
    border: none;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: clamp(11px, 1.8vw, 13px);
    font-weight: 500;
    min-width: 60px;
    text-align: center;
    white-space: nowrap;
}

.action-button:hover {
    background: #d0d0d0;
    color: #333;
}

/* 复制成功状态样式 */
.action-button.copied {
    background: #4caf50 !important;
    color: white !important;
}

/* 状态样式 */
.loading-state,
.error-state,
.no-data-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: #ffffff;
    border-radius: 15px;
    text-align: center;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-icon,
.no-data-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.loading-state p,
.error-state p,
.no-data-state p {
    /* 响应式字体大小，适当放大 */
    font-size: clamp(22px, 4.5vw, 30px);
    color: #666;
    margin-bottom: 15px;
}

.retry-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 25px;
    /* 响应式字体大小，适当放大 */
    font-size: clamp(22px, 3.5vw, 28px);
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-button:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

/* 响应式设计 */
/* 中等屏幕 */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .announcement-card {
        padding: 25px;
    }
    
    .info-row {
        gap: 14px;
    }
    
    .info-label {
        min-width: clamp(90px, 12vw, 110px);
    }
}

/* 小屏幕但保持左右布局 */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .search-container {
        max-width: 100%;
        margin-bottom: 15px;
    }
    
    .search-input {
        padding: 15px 50px 15px 18px;
    }
    
    .search-icon {
        right: 18px;
    }
    
    .announcement-card {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .card-content {
        gap: 12px;
    }
    
    .info-row {
        gap: 12px;
        /* 保持左右布局，不改为垂直 */
        flex-direction: row;
        align-items: center;
    }
    
    .info-label {
        /* 缩小标签宽度但保持左右布局 */
        min-width: clamp(70px, 10vw, 90px);
        margin-bottom: 0;
    }
    
    .info-value {
        margin-left: 0;
    }
}

/* 只有超小屏幕才使用垂直布局 */
@media (max-width: 400px) {
    .container {
        padding: 8px;
    }
    
    .announcement-card {
        padding: 15px;
    }
    
    .card-title {
        margin-bottom: 15px;
        gap: 10px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .exam-type-tag {
        padding: 6px 12px;
    }
    
    /* 只在超小屏幕使用垂直布局 */
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .info-label {
        min-width: auto;
        margin-bottom: 2px;
    }
}

/* 动画效果 */
.announcement-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 为动态添加的卡片设置延迟动画 */
.announcement-card:nth-child(1) { animation-delay: 0.1s; }
.announcement-card:nth-child(2) { animation-delay: 0.2s; }
.announcement-card:nth-child(3) { animation-delay: 0.3s; }
.announcement-card:nth-child(4) { animation-delay: 0.4s; }
.announcement-card:nth-child(5) { animation-delay: 0.5s; }

/* 职位详情弹窗样式 */
.position-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    max-width: 95vw;
    max-height: 95vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    max-width: calc(100% - 40px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: #dee2e6;
    color: #495057;
}

.modal-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 12px;
}

.file-info p {
    margin: 0;
    font-size: 16px;
    color: #495057;
    flex: 1;
    min-width: 200px;
}

.file-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.download-btn, .preview-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.download-btn {
    background: #007bff;
    color: white;
}

.download-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.preview-btn {
    background: #28a745;
    color: white;
}

.preview-btn:hover {
    background: #1e7e34;
    transform: translateY(-1px);
}

.excel-preview {
    flex: 1;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.loading-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #6c757d;
    background: #f8f9fa;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.loading-spinner.active {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.excel-table-container {
    overflow: auto;
    height: 100%;
    padding: 0;
}

.excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-family: 'Microsoft YaHei', 'SimHei', 'SimSun', Arial, sans-serif; /* 添加中文字体支持 */
}

.excel-table th,
.excel-table td {
    padding: 12px 16px;
    text-align: left;
    border: 1px solid #dee2e6;
    word-wrap: break-word; /* 自动换行 */
    word-break: break-all; /* 强制换行 */
    vertical-align: top; /* 顶部对齐 */
}

.excel-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 1;
}

.excel-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.excel-table tbody tr:hover {
    background: #e3f2fd;
}

.table-note {
    background: #fff3cd !important;
    color: #856404;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    padding: 16px !important;
    font-family: 'Microsoft YaHei', 'SimHei', 'SimSun', Arial, sans-serif; /* 添加中文字体支持 */
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        margin: 10px;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }
    
    .file-info {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .file-actions {
        justify-content: center;
    }
    
    .excel-table {
        font-size: 12px;
    }
    
    .excel-table th,
    .excel-table td {
        padding: 8px 12px;
    }
}